<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>filter</title>
	</head>
	<body>
		<script>
			// filter 方法返回一个新数组，新数组中的元素是通过了测试函数的原数组中的元素
			// 若没有一个元素通过，则返回一个空数组

			let arr = [1, 5, 9, 10, 20, 35];
			const passThisFunction = (currentValue) => currentValue > 10;
			let arr1 = arr.filter(passThisFunction);
			console.log(arr1);
		</script>
	</body>
</html>
